import React from "react";
import "./index.less";
import {Col, Row, Statistic} from 'antd';
import {useRequest} from "umi";
import * as API from "@/services";

const HomePage: React.FC = () => {
  const siteInfoReq= useRequest(()=> API.querySiteAboutInfo())
  const siteInfo= siteInfoReq.data;

  return (
    <div className={"home-container"}>
     <h2>欢迎使用华西期刊社一体化平台后台管理端</h2>
      <Row gutter={16}>
        <Col span={6}>
          <Statistic title="期刊社成立年" value={siteInfo?.establishYear}  />
        </Col>
        <Col span={6}>
          <Statistic title="期刊数量" value={siteInfo?.journalNum}   />
        </Col>
        <Col span={6}>
          <Statistic title="中文期刊数量" value={siteInfo?.journalCnNum}   />
        </Col>
        <Col span={6}>
          <Statistic title="英文期刊数量" value={siteInfo?.journalEnNum}   />
        </Col>
      </Row>
    </div>
  );
};

export default HomePage;
